package cn.edu.zju.oms.container;

import com.github.kfcfans.powerjob.worker.core.processor.ProcessResult;
import com.github.kfcfans.powerjob.worker.core.processor.TaskContext;
import com.github.kfcfans.powerjob.worker.core.processor.sdk.BasicProcessor;
import org.springframework.stereotype.Component;

/**
 * 简单处理器
 *
 * @author tjq
 * @since 2020/6/7
 */
@Component
public class SimpleStandaloneProcessor implements BasicProcessor {
    @Override
    public ProcessResult process(TaskContext taskContext) throws Exception {

        taskContext.getOmsLogger().info("TaskContext is {}", taskContext.toString());
        System.out.println("===== SimpleStandaloneProcessor =====");

        return new ProcessResult(!"failed".equals(taskContext.getJobParams()), "process success~");
    }
}
